{itemplate 'public/header'} 
{if $ta == 'index'}
<div class="page page-paybill">
	<header class="bar bar-nav common-bar-nav">
		<a href="javascript:;" class="pull-left back"><i class="icon icon-arrow-left"></i></a>
		<h1 class="title open-popup">账单</h1>
	</header>
	{itemplate 'public/nav'}
	<div class="content infinite-scroll js-infinite" data-href="{php echo imurl('manage/paycenter/paybill/more', array('pay_type' => $pay_type))}" data-distance="50" data-min="{$min}" data-container=".paybill-order-list" data-tpl="tpl-paybill-order">
		<div class="buttons-tab">
			<a href="{php echo imurl('manage/paycenter/paybill/index', array('pay_type' => 'all'));}" class="button {if $pay_type == 'all'}active{/if}">所有</a>
			<a href="{php echo imurl('manage/paycenter/paybill/index', array('pay_type' => 'wechat'));}" class="button {if $pay_type == 'wechat'}active{/if}">微信</a>
			<a href="{php echo imurl('manage/paycenter/paybill/index', array('pay_type' => 'alipay'));}" class="button {if $pay_type == 'alipay'}active{/if}">支付宝</a>
			<a href="{php echo imurl('manage/paycenter/paybill/index', array('pay_type' => 'credit'));}" class="button {if $pay_type == 'credit'}active{/if}">余额</a>
		</div>
		<div class="paybill-order-list">
			{if empty($orders)}
				<div class="no-data">
					<div class="bg"></div>
					<p>没有任何订单哦～</p>
				</div>
			{else}
				{loop $orders $order}
					<a href="{php echo imurl('manage/paycenter/paybill/detail', array('id' => $order['id']));}" class="paybill-item clearfix border-1px-tb">
						<span class="pay-type">
							<span class="type {$order['pay_type']}"></span>
						</span>
						<span class="pay-content">
							<div class="top">
								#<b class="order-sn">{$order['serial_sn']}</b>
								<span class="username">{$order['nickname']}</span>
							</div>
							<div class="bottom">
								{php echo date('Y-m-d H:i:s', $order['addtime'])}
							</div>
						</span>
						<span class="pay-price">
							<div class="total-fee">
								<span>顾客支付</span>¥{$order['final_fee']}
							</div>
							<div class="store-final-fee">
								<span>最终收入</span>¥{$order['store_final_fee']}
							</div>
						</span>
					</a>
				{/loop}
			{/if}
		</div>
	</div>
</div>

<script id="tpl-paybill-order" type="text/html">
	<{# for(var i = 0, len = d.length; i < len; i++){ }>
		<a href="{php echo imurl('manage/paycenter/paybill/detail');}&id=<{d[i].id}>" class="paybill-item clearfix border-1px-tb">
			<span class="pay-type">
				<span class="type <{d[i].pay_type}>"></span>
			</span>
			<span class="pay-content">
				<div class="top">
					#<b class="order-sn"><{d[i].serial_sn}></b>
					<span class="username"><{d[i].nickname}></span>
				</div>
				<div class="bottom">
					<{d[i].addtime}>
				</div>
			</span>
			<span class="pay-price">
				<div class="total-fee">
					<span>顾客支付</span>¥<{d[i].final_fee}>
				</div>
				<div class="store-final-fee">
					<span>最终收入</span>¥<{d[i].store_final_fee}>
				</div>
			</span>
		</a>
	<{# } }>
</script>
{/if}

{if $ta == 'detail'}
<div class="page paybill-detail">
	<header class="bar bar-nav common-bar-nav">
		<a href="javascript:;" class="pull-left back"><i class="icon icon-arrow-left"></i></a>
		<h1 class="title open-popup">账单详情</h1>
	</header>
	{itemplate 'public/nav'}
	<div class="content">
		<div class="wui-form-preview">
  			<div class="wui-form-preview-hd">
    			<label class="wui-form-preview-label">顾客支付金额</label>
    			<em class="wui-form-preview-value">¥{$order['final_fee']}</em>
  			</div>
	 		<div class="wui-form-preview-bd">
	    		<div class="wui-form-preview-item">
	      			<label class="wui-form-preview-label">订单号</label>
	      			<span class="wui-form-preview-value">{$order['order_sn']}</span>
	    		</div>
	    		<div class="wui-form-preview-item">
	     			<label class="wui-form-preview-label">支付方式</label>
	      			<span class="wui-form-preview-value">{php echo to_paytype($order['pay_type'], 'text')}</span>
	    		</div>
	    		<div class="wui-form-preview-item">
	      			<label class="wui-form-preview-label">消费总额</label>
	      			<span class="wui-form-preview-value">¥ {$order['total_fee']}</span>
	    		</div>
	    		<div class="wui-form-preview-item">
	      			<label class="wui-form-preview-label">不参与优惠金额</label>
	      			<span class="wui-form-preview-value">¥ {$order['no_discount_part']}</span>
	    		</div>
	    		<div class="wui-form-preview-item">
	      			<label class="wui-form-preview-label">优惠金额</label>
	      			<span class="wui-form-preview-value">¥ {$order['discount_fee']}</span>
	    		</div>
	    		<div class="wui-form-preview-item">
	      			<label class="wui-form-preview-label">平台抽取佣金</label>
	      			<span class="wui-form-preview-value">¥ {$order['plateform_serve_fee']}</span>
	    		</div>
	    		<div class="wui-form-preview-item">
	      			<label class="wui-form-preview-label">商户预计收入</label>
	      			<span class="wui-form-preview-value">¥ {$order['store_final_fee']}</span>
	    		</div>
	  		</div>
		</div>
	</div>
</div>
{/if}
{itemplate 'public/footer'}